Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add global change hook #11

Merged
merged 4 commits into from
Sep 13, 2024
Merged

Add global change hook #11

merged 4 commits into from
Sep 13, 2024

Conversation

xpple
Copy link
Owner

@xpple xpple commented Sep 12, 2024

Adds support for a global change callback that is called whenever any configuration value is updated. For example:

new ModConfigBuilder<>("<mod id>", Configs.class)
    .registerGlobalChangeHook(event -> LOGGER.info("{} was updated | old: {}, new: {}", event.config(), event.oldValue(), event.newValue()))
    .build();

@xpple xpple merged commit f288487 into master Sep 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants